package com.hnx.admin.aurora.system.controller;

import com.hnx.admin.aurora.annotation.Log;
import com.hnx.admin.aurora.enums.BusinessType;
import com.hnx.admin.aurora.system.domain.param.log.query.OperLogQuery;
import com.hnx.admin.aurora.system.service.SysOperlogService;
import com.hnx.admin.aurora.web.json.ResultJson;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/*
创建人： 倔强的头发
创建时间：2025/6/19
功能描述:

*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/monitor/operlog")
public class SysOperlogController {
    private final SysOperlogService operLogService;

    @PreAuthorize("@auth.hasPermi('monitor:operlog:list')")
    @GetMapping("/list")
    public ResultJson list(OperLogQuery operLog)
    {
        return operLogService.selectOperLogList(operLog);
    }
    @Log(title = "操作日志", businessType = BusinessType.EXPORT)
    @PreAuthorize("@auth.hasPermi('monitor:operlog:export')")
    @PostMapping("/export")
    public void export(HttpServletResponse response)
    {
        operLogService.export(response);
    }
}
